/*
 * Copyright 2008 Max Kugland
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.splink.library.observer {

	/**
	 * Basic Interface for <code>IObserver</code> implementations. <code>IObserver</code>s can 
	 * subscribe to <code>ISubject</code>s to receive information related to <code>ISubject</code>.
	 * 
	 * @author Max Kugland
	 */
	public interface IObserver {
		/**
		 * The update method of the <code>IObserver</code> implementing objects gets invoked by the subject 
		 * it has registred with. The <code>IObserver</code> gets a reference to the subject to pull
		 * data or optionally gets pushed data by the <code>ISubject</code>
		 *
		 * @param data the <code>ISubject</code> which invoked the update method
		 * @param data optional data which can be pushed to from the <code>ISubject</code>
		 */
		function update(subject : ISubject, data : *) : void; 
	}
}
